<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
<%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath();
%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 		<link rel="stylesheet" type="text/css" href="<%=basePath %>/css/updateVideo.css" />
		<link rel="stylesheet" href="<%=basePath %>css/list.css">
		<link href="<%=basePath %>css/H-ui.min.css" rel="stylesheet" type="text/css" />
		<link href="<%=basePath %>/css/H-ui.min.css" rel="stylesheet" type="text/css" />
		<link href="<%=basePath %>/css/formsCSS.css" rel="stylesheet" type="text/css" />
		<script src="<%=basePath %>/js/jquery.min.js"></script>
		<script src="<%=basePath %>/js/formsJS.js"></script>
		<!-- kindeditor富文本编辑器 -->
		<link href="<%=basePath%>/kindeditor/themes/default/default.css">
		<link href="<%=basePath%>/kindeditor/plugins/code/prettify.css">
		<script src="<%=basePath%>/kindeditor/lang/zh-CN.js"></script>
		<script src="<%=basePath%>/kindeditor/kindeditor-all.js"></script>
		

<script type="text/javascript">

function checkForm(f){

	if(f.speakerName.value.replace(/\s/g,'') == ''){
		alert("讲师名称不能为空");
		return false;
	}
	if(f.status.value.replace(/\s/g,'') == ''){
		alert("状态不能为空");
		return false;
	}
	if(f.speakerDesc.value.replace(/\s/g,'') == ''){
		alert("讲师介绍不能为空");
		return false;
	}
	
 
	return true;
}

</script>
</head>
<body>
		<div class="connect_wrap">
    		<h3 style= "text-align: center;">讲师信息维护</h3>
			<div class="row cl" style="max-width:88%;margin-left:8%;">
			<div class="labelText"></div>
				<form action="<%=basePath%>/speaker/speakerEdit" method="post" onsubmit="return checkForm(this)"
					enctype="multipart/form-data">
					<div class="col-sm-4"></div>
	    					<div class="col-sm-4">
	    							<div class="boxs">
												<input type="hidden" name="id" value="${speaker.id}">
												<input type="text" class="inputBox" placeholder="讲师名称" name="speakerName" value="${speaker.speakerName}" >
												<input type="text" class="inputBox" placeholder="讲师职称" name="speakerTitle" value="${speaker.speakerTitle}" >
												<input type="text" class="inputBox" placeholder="讲师电话" name="speakerPhone" value="${speaker.speakerPhone}" >
												<input type="file" class="inputBox" placeholder="讲师头像" name=imageFile value="${speaker.speakerImage}" >
												<select id="status" name="status" class="selectBox"  >
												  	<option value="">讲师状态</option>
												  	<option value="1" ${speaker.status == 1 ? 'selected="seelcted"' : '' }>启用</option>
										  			<option value="2" ${speaker.status == 2 ? 'selected="seelcted"' : '' }>停用</option>
												</select>
												 
 												<br>
 												<textarea  id="speakerDesc" placeholder="讲师介绍" name="speakerDesc" class="inputBox kindeditor" style="width: 90%;">${speaker.speakerDesc}</textarea>
												 
												
												<input type="submit" value="确定" class="true" />
												<input type="button"  class="false" value="取消" onclick="window.history.go(-1)">
										</div>
								</div>
					</form>
			</div>
	</div>
	
</body>
<script type="text/javascript">
var editor;
KindEditor.ready(function(K) {
	
    editor = K.create('#speakerDesc', {
            uploadJson : '<%=basePath%>/kindeditor/upload',       
            fillDescAfterUploadImage: false,
            allowImageRemote:false,
            afterCreate : function() {
                var self = this;
                K.ctrl(document, 13, function() {
                    self.sync();
                });
                K.ctrl(self.edit.doc, 13, function() {
                    self.sync();
                });
            },
            afterBlur:function(){ 
                this.sync(); 
            } 
        });
});  


</script>
	 
</html>